<?php

class Form_Login extends App_Dojo_Form
{	
	public $_noDecorators = array(
                                    'DijitElement',
	);
	
	public $_selectUserTypes = array();
		    
    public function init()
    {
		$this->setName('formLogin');
 
        $this->setMethod('post');
        	
		$this->setDecorators(array(    
			'FormElements',    
			array(
				'HtmlTag', 
				array(
					'tag' => 'dl',
					'class' => 'form normal'
					)
			),    
			'DijitForm',
		));        
        
        $this->addElement(
        	'ValidationTextBox', 
        	'username', 
        	array(
	            'label'          	=> 'Username',
	            'required'       	=> true,
        		'promptMessage'		=> 'Enter your username.',
	            'invalidMessage' 	=> 'Please type your username.',
	            'trim'      		=> true,
	            'maxlength'      	=> 50,
        		'validators' 		=> array(
					'NotEmpty', 
        			array('StringLength', true, array(2, 50)),
            	),
        	)
        );
		
    	$this->addElement(
        	'PasswordTextBox', 
        	'password', 
        	array(
	            'label'          	=> 'Password',
	            'required'       	=> true,
	            'trim'       	 	=> true,
				'invalidMessage' 	=> 'Invalid password; ' . 'must be at least 6 alphanumeric characters',			
				'regExp'         	=> '^[a-z0-9]{6,}$'        
			)
		);
        
        $this->addElement(
        	'Button', 
        	'submitButton',
            array(
                'type'   	 => 'submit',
            	'required'   => false,
                'ignore'     => true,
                'label'      => 'Sign in',
            	'iconClass'	 => 'myIcons okIcon',
                'style' 		=> 'margin-top: 10px;',  
            )
        );
    }  
}